package com.joekai.view_demo.letter_index;

import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;

import com.joekai.view_demo.R;

/**
 * @author joekai
 */
public class LetterIndexListActivity extends AppCompatActivity {
    LetterIndexView letterSideBar;
    TextView textView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_letter_index_list);
        setTitle("字母索引列表");

        letterSideBar = findViewById(R.id.letterSideBar);
        textView = findViewById(R.id.tv_);
        letterSideBar.setOnLetterTouchListener((letter, isVisible) -> {
            Log.e("------", letter.toString() + "/" + isVisible);
            textView.setText(letter);
            textView.setVisibility(isVisible);

        });
        letterSideBar.setSelectedItem(0);
    }
}